<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<include file="Public:meta" />
    <style>
    	.rank1{ color: red;}
		.rank2{ color: blue;}
		.rank3{ color: green;}
    </style>
</head>
<body id="main_page">
<include file="Public:position" />
<div class="container">
    <form enctype="multipart/form-data" method="post" id="frm">
    	<input type="hidden" name="p" id="p" value="{$NowPage}" />
       <div class="table">
           <div class="toolbars">
                <li class="toolbar"><a id="selectall" onclick="CheckAll()"  title="全选">全选</a></li>
                <li class="toolbar"><a id="del" onclick="BatchDel()" title="批量删除">删除</a></li>
            </div>
            <table class="datatable" id="datatable">
            <tr>
                <th width="40px"  nowrap="nowrap">选中</th>
                <th width="50px" >评论ID</th>
                <th width="300px" >评论对象</th>
                <th width="70px" >评论等级</th>
                <th>评论内容</th>
                <th width="130px" >评论时间</th>
                <th width="70px" >是否审核</th>
                <th style="width:190px;">操作</th>
            </tr>
            <notempty name="Data">
                <volist name="Data" id="d">
                    <tr id="tr{$d.CommentID}">
                    <td><input class="checkrow" type="checkbox" name="id[]" value="{$d.CommentID}" /></td>
                    <td>{$d.CommentID}</td>
                    <td><a href="{$d.InfoID|InfoUrl}" target="_blank">{$d.InfoID|InfoTitle}</a></td>
                    <td>
                        <span class="rank{$d.CommentRank}">
                            <switch name="d.CommentRank">
                                <case value="1">差评</case>
                                <case value="2">中评</case>
                                <case value="3">好评</case>
                            </switch>
                        </span>
                    </td>
                    <td style=" text-align:left;">{$d.CommentContent}</td>
                    <td>{$d.CommentTime|strtotime|yd_friend_date}</td>
                    <td><eq name="d.IsCheck" value="1"><span style="color:black">已审核</span>
                    <else/><span style="color:red">未审核</span></eq>
                    </td>
                    <td class="operator">
                        <a style="float:left" onclick="del({$d.CommentID})" class="btnDel">删除</a>
                        <notempty name="d.ReplyCount">
                            <div class="btn-sep"></div>
                            <a style="float:left; padding-left:30px;" id="btnSaveAll" name="btnSaveAll" href="{$Url}reply/id/{$d.CommentID}">查看回复({$d.ReplyCount})</a>
                        </notempty>
                    </td>
                    </tr>
                </volist>  
            <else/>
                <tr><td colspan="8"  id="NoData">{$Think.lang.NoDataTip}</td></tr>
            </notempty>                             
            </table>
            <div class="tfoot"><div class="page">{$Page}</div></div>
        </div>
    </form>
</div>
</body>
</html>
<script type="text/javascript">
function del(id){
	$.confirm("{$Think.lang.DeleteTip}", function () {
		url = "{$Url}del/id/"+id+"/p/{$NowPage}";
		location.href = url;
	}, function () {
		return true;
	});
}

//批量删除
function BatchDel(){
	var arrChk = $("input[name='id[]']");
	var n = 0;
	for(var i = 0; i < arrChk.length; i++){
		if(arrChk[i].checked) n++;
	}
	
	if( n == 0 ) {
		WarnBox("{$Think.lang.CheckDeleteTip}");
		return;
	}
	
	$.confirm("{$Think.lang.DeleteTip}", function () {
		$('#frm').attr("action", "__URL__/del");
		$('#frm').submit();
	}, function () {
		return true;
	});
}
</script>